import Vue from 'vue'
import VueRouter from 'vue-router'


import register from '../views/register/Register.vue'
import login from '../views/login/Login.vue'
import index from '../views/index/Index.vue'
import goodlist from '../views/goodlist/Goodlist.vue'
import gooddesc from '../views/gooddesc/Gooddesc.vue'
import orderconfirm from '../views/orderconfirm/Orderconfirm.vue'
import addressadd from "../views/address/Add.vue"
Vue.use(VueRouter)
const routes = [
    {
        path: '/register',
        component: register
    },
    {
        path: "/login",
        component: login
    },
    {
        path:"/addressadd",
        component:addressadd
    },
    {
        path: '/',
        component: index,
        children: [
            {
                path: "home",
                component: () => import("../views/home/Home.vue")
            },

            {
                path: "cate",
                component: () => import("../views/cate/Cate.vue")
            },
            
            {
                path: "cart",
                component: () => import("../views/cart/Cart.vue")
            },
           {
                path:"user",
                component:()=>import("../views/user/User.vue")
            },

            {
                path: "/",
                redirect: "home"
            },
        ]
    },

    {
        path: '/goodlist',
        component: goodlist
    },
    {
        path: '/gooddesc',
        component: gooddesc
    },
    {
        path: '/orderconfirm',
        component: orderconfirm
    },
    {
        path: "*",
        component: () => import('../views/404/Notfound.vue')
    },
    {
        path: '/http',
        component: () => import('../views/http/Index.vue')
    },{
        path:"/proxy",
        component:()=>import('../views/proxy/Index.vue')
    }
]

const router = new VueRouter({
    routes
})

export default router
